﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

namespace FwProject.Migrations
{
    public partial class Update_To_fwyg_201808311630 : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AddColumn<int>(
                name: "BalanceWayEnum",
                table: "SettlementInfo",
                nullable: false,
                defaultValue: 0);

            migrationBuilder.AddColumn<string>(
                name: "DeliveryDate",
                table: "SettlementInfo",
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "RemarksConten",
                table: "SettlementInfo",
                nullable: true);

            migrationBuilder.CreateTable(
                name: "PaymentInfo",
                columns: table => new
                {
                    Id = table.Column<Guid>(nullable: false),
                    CreationTime = table.Column<DateTime>(nullable: false),
                    CreatorUserId = table.Column<long>(nullable: true),
                    LastModificationTime = table.Column<DateTime>(nullable: true),
                    LastModifierUserId = table.Column<long>(nullable: true),
                    IsDeleted = table.Column<bool>(nullable: false),
                    DeleterUserId = table.Column<long>(nullable: true),
                    DeletionTime = table.Column<DateTime>(nullable: true),
                    PaymentNumber = table.Column<string>(nullable: true),
                    ReceiptInfoId = table.Column<Guid>(nullable: false),
                    RemarksConten = table.Column<string>(nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_PaymentInfo", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "PrePaymentInfo",
                columns: table => new
                {
                    Id = table.Column<Guid>(nullable: false),
                    CreationTime = table.Column<DateTime>(nullable: false),
                    CreatorUserId = table.Column<long>(nullable: true),
                    LastModificationTime = table.Column<DateTime>(nullable: true),
                    LastModifierUserId = table.Column<long>(nullable: true),
                    IsDeleted = table.Column<bool>(nullable: false),
                    DeleterUserId = table.Column<long>(nullable: true),
                    DeletionTime = table.Column<DateTime>(nullable: true),
                    CapitalAccountId = table.Column<Guid>(nullable: false),
                    AccountNo = table.Column<string>(nullable: true),
                    AccountName = table.Column<string>(nullable: false),
                    AgentPeoperUserId = table.Column<long>(nullable: false),
                    AgentPeoper = table.Column<string>(nullable: false),
                    RestaurantInfoName = table.Column<long>(nullable: false),
                    RestaurantInfoId = table.Column<string>(nullable: false),
                    PrePaymentPrice = table.Column<decimal>(nullable: false),
                    RemarkContent = table.Column<string>(nullable: true),
                    PrePaymentInfoType = table.Column<int>(nullable: false),
                    PrePaymentInfoStatus = table.Column<int>(nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_PrePaymentInfo", x => x.Id);
                });
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "PaymentInfo");

            migrationBuilder.DropTable(
                name: "PrePaymentInfo");

            migrationBuilder.DropColumn(
                name: "BalanceWayEnum",
                table: "SettlementInfo");

            migrationBuilder.DropColumn(
                name: "DeliveryDate",
                table: "SettlementInfo");

            migrationBuilder.DropColumn(
                name: "RemarksConten",
                table: "SettlementInfo");
        }
    }
}
